<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>Who's voted me</title>
    <script type="text/javascript" src="/voteup/resources/js/jquery-1.6.1.js"></script>
    <script type="text/javascript" src="/voteup/resources/js/stylescript.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".pane-list li").click(function() {
                window.location = $(this).find("a").attr("href");
                return false;
            });
        });
    </script>
</head>
<body>
<c:import url="/WEB-INF/jsp/header.jsp"/>
<c:import url="/WEB-INF/jsp/menu.jsp"/>
<center>
    <c:if test="${not empty votes}">
        <p>

        <h3>These people voted for you:</h3></p>
        <ul class="pane-list">
            <c:forEach items="${votes}" var="vote">
                <li>
                    <table width="85%" cellspacing="4" cellpadding="3">
                        <tr>
                            <td>
                                <a href="/voteup//persons/${vote.fromPerson.personId}">
                                    <p align="center"><img
                                            src="/voteup/resources/img/avatars/${vote.fromPerson.avatar}.jpg"
                                            width="60"
                                            height="80"
                                            border="0"></p>
                                </a></td>
                            <td>
                                <a href="/voteup//persons/${vote.fromPerson.personId}">
                                    <p align="center">${vote.fromPerson.lastName} ${vote.fromPerson.firstName} ${vote.fromPerson.middleName} </p>
                                </a>
                            </td>
                            <td>
                                <p align="right">${vote.date}</p>
                            </td>
                        </tr>
                    </table>
                </li>
            </c:forEach>
        </ul>
    </c:if>
    <c:if test="${empty votes}">
        <h3>Nobody has voted for you yet</h3>
    </c:if>
</center>
</body>
</html>